package cn.iocoder.yudao.module.digital.service.cardchannel.model.bamboo;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created, Processed, Pending, Succeeded, Failed, PartialFailed, Processing
 */
@Getter
@AllArgsConstructor
public enum BambooOrderStatusEnum {
    Created("Created", "已创建"),
    Pending("Pending", "待处理"),
    Processed("Processed", "已处理"),
    Succeeded("Succeeded", "成功"),
    Failed("Failed", "失败"),
    PartialFailed("PartialFailed", "部分失败"),
    Processing("Processing", "处理中"),
    ;

    private final String value;
    private final String desc;

    public String getValue() {
        return value;
    }

    public static BambooOrderStatusEnum fromValue(String value) {
        for (BambooOrderStatusEnum type : values()) {
            if (type.value.equals(value)) {
                return type;
            }
        }
        throw new IllegalArgumentException("枚举类型 BambooOrderStatusEnum 不支持的值：" + value);
    }

}
